"""
商户配置相关模型
"""

from jlpay.model.base import OrgBaseReq, BaseResponse
from jlpay.utils.annotation_utils import Encrypt, Sensitive, SensitiveField


# ==================== 商户分账查询 ====================
class MerchRevQueryRequest(OrgBaseReq):
    """商户分账查询请求"""
    
    API_URL = "/open/ledger/merch/rev/query"
    
    def __init__(self):
        """初始化商户分账查询请求"""
        super().__init__()
        self.org_code = None
        self.mch_id = None
    
    def set_org_code(self, org_code):
        """
        设置机构代码
        
        Args:
            org_code: 机构代码
            
        Returns:
            MerchRevQueryRequest实例
        """
        self.org_code = org_code
        return self
    
    def set_mch_id(self, mch_id):
        """
        设置商户号
        
        Args:
            mch_id: 商户号
            
        Returns:
            MerchRevQueryRequest实例
        """
        self.mch_id = mch_id
        return self


class MerchRevQueryResponse(BaseResponse):
    """商户分账查询响应"""
    
    def __init__(self, response_dict=None):
        """
        初始化商户分账查询响应
        
        Args:
            response_dict: 响应字典
        """
        super().__init__(response_dict)
        self.org_code = None
        self.mch_id = None
        self.merch_type = None
        self.license_number = None
        self.license_name = None
        self.license_address = None
        self.license_begin_date = None
        self.license_end_date = None
        self.legal_name = None
        self.legal_number = None
        self.legal_begin_date = None
        self.legal_end_date = None
        self.mobile = None
        self.bank_card_no = None
        self.bank_card_name = None
        self.bank_code = None
        self.bank_name = None
        self.bank_branch_code = None
        self.bank_branch_name = None
        self.apply_status = None
        
        if response_dict:
            self.org_code = response_dict.get('org_code')
            self.mch_id = response_dict.get('mch_id')
            self.merch_type = response_dict.get('merch_type')
            self.license_number = response_dict.get('license_number')
            self.license_name = response_dict.get('license_name')
            self.license_address = response_dict.get('license_address')
            self.license_begin_date = response_dict.get('license_begin_date')
            self.license_end_date = response_dict.get('license_end_date')
            self.legal_name = response_dict.get('legal_name')
            self.legal_number = response_dict.get('legal_number')
            self.legal_begin_date = response_dict.get('legal_begin_date')
            self.legal_end_date = response_dict.get('legal_end_date')
            self.mobile = response_dict.get('mobile')
            self.bank_card_no = response_dict.get('bank_card_no')
            self.bank_card_name = response_dict.get('bank_card_name')
            self.bank_code = response_dict.get('bank_code')
            self.bank_name = response_dict.get('bank_name')
            self.bank_branch_code = response_dict.get('bank_branch_code')
            self.bank_branch_name = response_dict.get('bank_branch_name')
            self.apply_status = response_dict.get('apply_status')


# ==================== 商户分账解绑 ====================
class MerchRevUnbindRequest(OrgBaseReq):
    """商户分账解绑请求"""
    
    API_URL = "/open/ledger/merch/rev/unbind"
    
    def __init__(self):
        """初始化商户分账解绑请求"""
        super().__init__()
        self.org_code = None
        self.mch_id = None
        self.rev_mch_id = None
    
    def set_org_code(self, org_code):
        """
        设置机构代码
        
        Args:
            org_code: 机构代码
            
        Returns:
            MerchRevUnbindRequest实例
        """
        self.org_code = org_code
        return self
    
    def set_mch_id(self, mch_id):
        """
        设置商户号
        
        Args:
            mch_id: 商户号
            
        Returns:
            MerchRevUnbindRequest实例
        """
        self.mch_id = mch_id
        return self
    
    def set_rev_mch_id(self, rev_mch_id):
        """
        设置接收方商户号
        
        Args:
            rev_mch_id: 接收方商户号
            
        Returns:
            MerchRevUnbindRequest实例
        """
        self.rev_mch_id = rev_mch_id
        return self


class MerchRevUnbindResponse(BaseResponse):
    """商户分账解绑响应"""
    
    def __init__(self, response_dict=None):
        """
        初始化商户分账解绑响应
        
        Args:
            response_dict: 响应字典
        """
        super().__init__(response_dict)
        # 没有其他特定字段，只使用基础响应字段ret_code和ret_msg


# ==================== 商户文件上传 ====================
class MerchFileUploadRequest(OrgBaseReq):
    """商户文件上传请求"""
    
    API_URL = "/open/ledger/merch/file/upload"
    
    def __init__(self):
        """初始化商户文件上传请求"""
        super().__init__()
        self.org_code = None
        self.file_base64 = None
    
    def set_org_code(self, org_code):
        """
        设置机构代码
        
        Args:
            org_code: 机构代码
            
        Returns:
            MerchFileUploadRequest实例
        """
        self.org_code = org_code
        return self
    
    def set_file_base64(self, file_base64):
        """
        设置文件Base64编码
        
        Args:
            file_base64: 文件Base64编码
            
        Returns:
            MerchFileUploadRequest实例
        """
        self.file_base64 = file_base64
        return self


class MerchFileUploadResponse(BaseResponse):
    """商户文件上传响应"""
    
    def __init__(self, response_dict=None):
        """
        初始化商户文件上传响应
        
        Args:
            response_dict: 响应字典
        """
        super().__init__(response_dict)
        self.org_code = None
        self.source_id = None
        
        if response_dict:
            self.org_code = response_dict.get('org_code')
            self.source_id = response_dict.get('source_id')


# ==================== 商户分账开通 ====================
class MerchIssueOpenRequest(OrgBaseReq):
    """商户分账开通请求"""
    
    API_URL = "/open/ledger/merch/issue/open"
    
    def __init__(self):
        """初始化商户分账开通请求"""
        super().__init__()
        self.org_code = None
        self.mch_id = None
        self.ledger_module = None
        self.max_split_rate = None
        self.source_ids = None
        self.fee_rate = None
        self.pbthf = None
        self.low_amt = None
        self.up_amt = None
        self.notify_url = None
    
    def set_org_code(self, org_code):
        """
        设置机构代码
        
        Args:
            org_code: 机构代码
            
        Returns:
            MerchIssueOpenRequest实例
        """
        self.org_code = org_code
        return self
    
    def set_mch_id(self, mch_id):
        """
        设置商户号
        
        Args:
            mch_id: 商户号
            
        Returns:
            MerchIssueOpenRequest实例
        """
        self.mch_id = mch_id
        return self
    
    def set_ledger_module(self, ledger_module):
        """
        设置账本模块
        
        Args:
            ledger_module: 账本模块
            
        Returns:
            MerchIssueOpenRequest实例
        """
        self.ledger_module = ledger_module
        return self
    
    def set_max_split_rate(self, max_split_rate):
        """
        设置最大分账比例
        
        Args:
            max_split_rate: 最大分账比例
            
        Returns:
            MerchIssueOpenRequest实例
        """
        self.max_split_rate = max_split_rate
        return self
    
    def set_source_ids(self, source_ids):
        """
        设置来源ID列表
        
        Args:
            source_ids: 来源ID列表
            
        Returns:
            MerchIssueOpenRequest实例
        """
        self.source_ids = source_ids
        return self
    
    def set_fee_rate(self, fee_rate):
        """
        设置费率
        
        Args:
            fee_rate: 费率
            
        Returns:
            MerchIssueOpenRequest实例
        """
        self.fee_rate = fee_rate
        return self
    
    def set_pbthf(self, pbthf):
        """
        设置保底后收费
        
        Args:
            pbthf: 保底后收费
            
        Returns:
            MerchIssueOpenRequest实例
        """
        self.pbthf = pbthf
        return self
    
    def set_low_amt(self, low_amt):
        """
        设置最低金额
        
        Args:
            low_amt: 最低金额
            
        Returns:
            MerchIssueOpenRequest实例
        """
        self.low_amt = low_amt
        return self
    
    def set_up_amt(self, up_amt):
        """
        设置最高金额
        
        Args:
            up_amt: 最高金额
            
        Returns:
            MerchIssueOpenRequest实例
        """
        self.up_amt = up_amt
        return self
    
    def set_notify_url(self, notify_url):
        """
        设置通知URL
        
        Args:
            notify_url: 通知URL
            
        Returns:
            MerchIssueOpenRequest实例
        """
        self.notify_url = notify_url
        return self


class MerchIssueOpenResponse(BaseResponse):
    """商户分账开通响应"""
    
    def __init__(self, response_dict=None):
        """
        初始化商户分账开通响应
        
        Args:
            response_dict: 响应字典
        """
        super().__init__(response_dict)
        # 没有其他特定字段，只使用基础响应字段ret_code和ret_msg


# ==================== 商户分账查询 ====================
class MerchIssueQueryRequest(OrgBaseReq):
    """商户分账查询请求"""
    
    API_URL = "/open/ledger/merch/issue/query"
    
    def __init__(self):
        """初始化商户分账查询请求"""
        super().__init__()
        self.org_code = None
        self.mch_id = None
    
    def set_org_code(self, org_code):
        """
        设置机构代码
        
        Args:
            org_code: 机构代码
            
        Returns:
            MerchIssueQueryRequest实例
        """
        self.org_code = org_code
        return self
    
    def set_mch_id(self, mch_id):
        """
        设置商户号
        
        Args:
            mch_id: 商户号
            
        Returns:
            MerchIssueQueryRequest实例
        """
        self.mch_id = mch_id
        return self


class MerchIssueQueryResponse(BaseResponse):
    """商户分账查询响应"""
    
    def __init__(self, response_dict=None):
        """
        初始化商户分账查询响应
        
        Args:
            response_dict: 响应字典
        """
        super().__init__(response_dict)
        self.org_code = None
        self.mch_id = None
        self.ledger_module = None
        self.max_split_rate = None
        self.source_ids = None
        self.fee_rate = None
        self.pbthf = None
        self.low_amt = None
        self.up_amt = None
        self.notify_url = None
        self.binds = None
        
        if response_dict:
            self.org_code = response_dict.get('org_code')
            self.mch_id = response_dict.get('mch_id')
            self.ledger_module = response_dict.get('ledger_module')
            self.max_split_rate = response_dict.get('max_split_rate')
            self.source_ids = response_dict.get('source_ids')
            self.fee_rate = response_dict.get('fee_rate')
            self.pbthf = response_dict.get('pbthf')
            self.low_amt = response_dict.get('low_amt')
            self.up_amt = response_dict.get('up_amt')
            self.notify_url = response_dict.get('notify_url')
            
            # 将 binds 字典列表转换为 Bind 对象列表
            binds_data = response_dict.get('binds', [])
            self.binds = []
            for bind_dict in binds_data:
                bind = Bind(bind_dict)
                self.binds.append(bind)


class Bind:
    """绑定信息"""
    
    def __init__(self, bind_dict=None):
        """
        初始化绑定信息
        
        Args:
            bind_dict: 绑定信息字典
        """
        self.rev_mch_id = None
        self.notify_url = None
        self.source_ids = None
        
        if bind_dict:
            self.rev_mch_id = bind_dict.get('rev_mch_id')
            self.notify_url = bind_dict.get('notify_url')
            self.source_ids = bind_dict.get('source_ids')


# ==================== 商户分账更新 ====================
class MerchIssueUpdateRequest(OrgBaseReq):
    """商户分账更新请求"""
    
    API_URL = "/open/ledger/merch/issue/update"
    
    def __init__(self):
        """初始化商户分账更新请求"""
        super().__init__()
        self.org_code = None
        self.mch_id = None
        self.ledger_module = None
        self.max_split_rate = None
        self.source_ids = None
        self.fee_rate = None
        self.pbthf = None
        self.low_amt = None
        self.up_amt = None
        self.notify_url = None
    
    def set_org_code(self, org_code):
        """
        设置机构代码
        
        Args:
            org_code: 机构代码
            
        Returns:
            MerchIssueUpdateRequest实例
        """
        self.org_code = org_code
        return self
    
    def set_mch_id(self, mch_id):
        """
        设置商户号
        
        Args:
            mch_id: 商户号
            
        Returns:
            MerchIssueUpdateRequest实例
        """
        self.mch_id = mch_id
        return self
    
    def set_ledger_module(self, ledger_module):
        """
        设置账本模块
        
        Args:
            ledger_module: 账本模块
            
        Returns:
            MerchIssueUpdateRequest实例
        """
        self.ledger_module = ledger_module
        return self
    
    def set_max_split_rate(self, max_split_rate):
        """
        设置最大分账比例
        
        Args:
            max_split_rate: 最大分账比例
            
        Returns:
            MerchIssueUpdateRequest实例
        """
        self.max_split_rate = max_split_rate
        return self
    
    def set_source_ids(self, source_ids):
        """
        设置来源ID列表
        
        Args:
            source_ids: 来源ID列表
            
        Returns:
            MerchIssueUpdateRequest实例
        """
        self.source_ids = source_ids
        return self
    
    def set_fee_rate(self, fee_rate):
        """
        设置费率
        
        Args:
            fee_rate: 费率
            
        Returns:
            MerchIssueUpdateRequest实例
        """
        self.fee_rate = fee_rate
        return self
    
    def set_pbthf(self, pbthf):
        """
        设置保底后收费
        
        Args:
            pbthf: 保底后收费
            
        Returns:
            MerchIssueUpdateRequest实例
        """
        self.pbthf = pbthf
        return self
    
    def set_low_amt(self, low_amt):
        """
        设置最低金额
        
        Args:
            low_amt: 最低金额
            
        Returns:
            MerchIssueUpdateRequest实例
        """
        self.low_amt = low_amt
        return self
    
    def set_up_amt(self, up_amt):
        """
        设置最高金额
        
        Args:
            up_amt: 最高金额
            
        Returns:
            MerchIssueUpdateRequest实例
        """
        self.up_amt = up_amt
        return self
    
    def set_notify_url(self, notify_url):
        """
        设置通知URL
        
        Args:
            notify_url: 通知URL
            
        Returns:
            MerchIssueUpdateRequest实例
        """
        self.notify_url = notify_url
        return self


class MerchIssueUpdateResponse(BaseResponse):
    """商户分账更新响应"""
    
    def __init__(self, response_dict=None):
        """
        初始化商户分账更新响应
        
        Args:
            response_dict: 响应字典
        """
        super().__init__(response_dict)
        # 没有其他特定字段，只使用基础响应字段ret_code和ret_msg


# ==================== 商户分账结算更新 ====================
class MerchRevSettleUpdateRequest(OrgBaseReq):
    """商户分账结算更新请求"""
    
    API_URL = "/open/ledger/merch/rev/settle/update"
    
    def __init__(self):
        """初始化商户分账结算更新请求"""
        super().__init__()
        self.org_code = None
        self.mch_id = None
        self.bank_card_no = None
        self.bank_card_name = None
        self.bank_code = None
        self.bank_name = None
        self.bank_branch_code = None
        self.bank_branch_name = None
    
    def set_org_code(self, org_code):
        """
        设置机构代码
        
        Args:
            org_code: 机构代码
            
        Returns:
            MerchRevSettleUpdateRequest实例
        """
        self.org_code = org_code
        return self
    
    def set_mch_id(self, mch_id):
        """
        设置商户号
        
        Args:
            mch_id: 商户号
            
        Returns:
            MerchRevSettleUpdateRequest实例
        """
        self.mch_id = mch_id
        return self
    
    def set_bank_card_no(self, bank_card_no):
        """
        设置银行卡号
        
        Args:
            bank_card_no: 银行卡号
            
        Returns:
            MerchRevSettleUpdateRequest实例
        """
        self.bank_card_no = bank_card_no
        return self
    
    def set_bank_card_name(self, bank_card_name):
        """
        设置银行卡姓名
        
        Args:
            bank_card_name: 银行卡姓名
            
        Returns:
            MerchRevSettleUpdateRequest实例
        """
        self.bank_card_name = bank_card_name
        return self
    
    def set_bank_code(self, bank_code):
        """
        设置银行代码
        
        Args:
            bank_code: 银行代码
            
        Returns:
            MerchRevSettleUpdateRequest实例
        """
        self.bank_code = bank_code
        return self
    
    def set_bank_name(self, bank_name):
        """
        设置银行名称
        
        Args:
            bank_name: 银行名称
            
        Returns:
            MerchRevSettleUpdateRequest实例
        """
        self.bank_name = bank_name
        return self
    
    def set_bank_branch_code(self, bank_branch_code):
        """
        设置银行支行代码
        
        Args:
            bank_branch_code: 银行支行代码
            
        Returns:
            MerchRevSettleUpdateRequest实例
        """
        self.bank_branch_code = bank_branch_code
        return self
    
    def set_bank_branch_name(self, bank_branch_name):
        """
        设置银行支行名称
        
        Args:
            bank_branch_name: 银行支行名称
            
        Returns:
            MerchRevSettleUpdateRequest实例
        """
        self.bank_branch_name = bank_branch_name
        return self


class MerchRevSettleUpdateResponse(BaseResponse):
    """商户分账结算更新响应"""
    
    def __init__(self, response_dict=None):
        """
        初始化商户分账结算更新响应
        
        Args:
            response_dict: 响应字典
        """
        super().__init__(response_dict)
        # 没有其他特定字段，只使用基础响应字段ret_code和ret_msg


# ==================== 商户分账绑定查询 ====================
class MerchRevBindQueryRequest(OrgBaseReq):
    """商户分账绑定查询请求"""
    
    API_URL = "/open/ledger/merch/rev/bind/query"
    
    def __init__(self):
        """初始化商户分账绑定查询请求"""
        super().__init__()
        self.org_code = None
        self.mch_id = None
        self.rev_mch_id = None
    
    def set_org_code(self, org_code):
        """
        设置机构代码
        
        Args:
            org_code: 机构代码
            
        Returns:
            MerchRevBindQueryRequest实例
        """
        self.org_code = org_code
        return self
    
    def set_mch_id(self, mch_id):
        """
        设置商户号
        
        Args:
            mch_id: 商户号
            
        Returns:
            MerchRevBindQueryRequest实例
        """
        self.mch_id = mch_id
        return self
    
    def set_rev_mch_id(self, rev_mch_id):
        """
        设置接收方商户号
        
        Args:
            rev_mch_id: 接收方商户号
            
        Returns:
            MerchRevBindQueryRequest实例
        """
        self.rev_mch_id = rev_mch_id
        return self


class MerchRevBindQueryResponse(BaseResponse):
    """商户分账绑定查询响应"""
    
    def __init__(self, response_dict=None):
        """
        初始化商户分账绑定查询响应
        
        Args:
            response_dict: 响应字典
        """
        super().__init__(response_dict)
        self.org_code = None  # 分账系统分配的机构号
        self.binding_status = None  # 绑定状态（0：待绑定，1：审核中，2：审核失败，3：审核成功）
        self.failed_reason = None  # 审核失败原因
        
        if response_dict:
            self.org_code = response_dict.get('org_code')
            self.binding_status = response_dict.get('binding_status')
            self.failed_reason = response_dict.get('failed_reason')


# ==================== 商户分账绑定 ====================
class MerchRevBindRequest(OrgBaseReq):
    """商户分账绑定请求"""
    
    API_URL = "/open/ledger/merch/rev/bind"
    
    def __init__(self):
        """初始化商户分账绑定请求"""
        super().__init__()
        self.org_code = None
        self.mch_id = None
        self.rev_mch_id = None
        self.notify_url = None
        self.source_ids = None
    
    def set_org_code(self, org_code):
        """
        设置机构代码
        
        Args:
            org_code: 机构代码
            
        Returns:
            MerchRevBindRequest实例
        """
        self.org_code = org_code
        return self
    
    def set_mch_id(self, mch_id):
        """
        设置商户号
        
        Args:
            mch_id: 商户号
            
        Returns:
            MerchRevBindRequest实例
        """
        self.mch_id = mch_id
        return self
    
    def set_rev_mch_id(self, rev_mch_id):
        """
        设置接收方商户号
        
        Args:
            rev_mch_id: 接收方商户号
            
        Returns:
            MerchRevBindRequest实例
        """
        self.rev_mch_id = rev_mch_id
        return self
    
    def set_notify_url(self, notify_url):
        """
        设置通知URL
        
        Args:
            notify_url: 通知URL
            
        Returns:
            MerchRevBindRequest实例
        """
        self.notify_url = notify_url
        return self
    
    def set_source_ids(self, source_ids):
        """
        设置来源ID列表
        
        Args:
            source_ids: 来源ID列表
            
        Returns:
            MerchRevBindRequest实例
        """
        self.source_ids = source_ids
        return self


class MerchRevBindResponse(BaseResponse):
    """商户分账绑定响应"""
    
    def __init__(self, response_dict=None):
        """
        初始化商户分账绑定响应
        
        Args:
            response_dict: 响应字典
        """
        super().__init__(response_dict)
        # 没有其他特定字段，只使用基础响应字段ret_code和ret_msg


class MerchRevOpenRequest(OrgBaseReq):
    """商户分账开通请求"""
    
    API_URL = "/open/ledger/merch/rev/open"
    
    def __init__(self):
        """初始化商户分账开通请求"""
        super().__init__()
        self.org_code = None
        self.merch_type = None
        self.mch_id = None
        self.license_number = None
        self.license_name = None
        self.license_address = None
        self.license_begin_date = None
        self.license_end_date = None
        self.license_front_source_id = None
        self.legal_name = None
        self.legal_number = None
        self.legal_begin_date = None
        self.legal_end_date = None
        self.legal_front_source_id = None
        self.legal_back_source_id = None
        self.mobile = None
        self.bank_card_no = None
        self.bank_card_name = None
        self.bank_code = None
        self.bank_name = None
        self.bank_branch_code = None
        self.bank_branch_name = None
        self.bank_front_source_id = None  # 银行卡正面照片
    
    def set_org_code(self, org_code):
        """
        设置机构代码
        
        Args:
            org_code: 机构代码
            
        Returns:
            MerchRevOpenRequest实例
        """
        self.org_code = org_code
        return self
    
    def set_merch_type(self, merch_type):
        """
        设置商户类型
        
        Args:
            merch_type: 商户类型
            
        Returns:
            MerchRevOpenRequest实例
        """
        self.merch_type = merch_type
        return self
    
    def set_mch_id(self, mch_id):
        """
        设置商户号
        
        Args:
            mch_id: 商户号
            
        Returns:
            MerchRevOpenRequest实例
        """
        self.mch_id = mch_id
        return self
    
    def set_license_number(self, license_number):
        """
        设置营业执照号
        
        Args:
            license_number: 营业执照号
            
        Returns:
            MerchRevOpenRequest实例
        """
        self.license_number = license_number
        return self
    
    def set_license_name(self, license_name):
        """
        设置营业执照名称
        
        Args:
            license_name: 营业执照名称
            
        Returns:
            MerchRevOpenRequest实例
        """
        self.license_name = license_name
        return self
    
    def set_license_address(self, license_address):
        """
        设置营业执照地址
        
        Args:
            license_address: 营业执照地址
            
        Returns:
            MerchRevOpenRequest实例
        """
        self.license_address = license_address
        return self
    
    def set_license_begin_date(self, license_begin_date):
        """
        设置营业执照开始日期
        
        Args:
            license_begin_date: 营业执照开始日期
            
        Returns:
            MerchRevOpenRequest实例
        """
        self.license_begin_date = license_begin_date
        return self
    
    def set_license_end_date(self, license_end_date):
        """
        设置营业执照结束日期
        
        Args:
            license_end_date: 营业执照结束日期
            
        Returns:
            MerchRevOpenRequest实例
        """
        self.license_end_date = license_end_date
        return self
    
    def set_license_front_source_id(self, license_front_source_id):
        """
        设置营业执照正面来源ID
        
        Args:
            license_front_source_id: 营业执照正面来源ID
            
        Returns:
            MerchRevOpenRequest实例
        """
        self.license_front_source_id = license_front_source_id
        return self
    
    def set_legal_name(self, legal_name):
        """
        设置法人姓名
        
        Args:
            legal_name: 法人姓名
            
        Returns:
            MerchRevOpenRequest实例
        """
        self.legal_name = legal_name
        return self
    
    def set_legal_number(self, legal_number):
        """
        设置法人身份证号
        
        Args:
            legal_number: 法人身份证号
            
        Returns:
            MerchRevOpenRequest实例
        """
        self.legal_number = legal_number
        return self
    
    def set_legal_begin_date(self, legal_begin_date):
        """
        设置法人身份证开始日期
        
        Args:
            legal_begin_date: 法人身份证开始日期
            
        Returns:
            MerchRevOpenRequest实例
        """
        self.legal_begin_date = legal_begin_date
        return self
    
    def set_legal_end_date(self, legal_end_date):
        """
        设置法人身份证结束日期
        
        Args:
            legal_end_date: 法人身份证结束日期
            
        Returns:
            MerchRevOpenRequest实例
        """
        self.legal_end_date = legal_end_date
        return self
    
    def set_legal_front_source_id(self, legal_front_source_id):
        """
        设置法人身份证正面来源ID
        
        Args:
            legal_front_source_id: 法人身份证正面来源ID
            
        Returns:
            MerchRevOpenRequest实例
        """
        self.legal_front_source_id = legal_front_source_id
        return self
    
    def set_legal_back_source_id(self, legal_back_source_id):
        """
        设置法人身份证背面来源ID
        
        Args:
            legal_back_source_id: 法人身份证背面来源ID
            
        Returns:
            MerchRevOpenRequest实例
        """
        self.legal_back_source_id = legal_back_source_id
        return self
    
    def set_mobile(self, mobile):
        """
        设置手机号
        
        Args:
            mobile: 手机号
            
        Returns:
            MerchRevOpenRequest实例
        """
        self.mobile = mobile
        return self
    
    def set_bank_card_no(self, bank_card_no):
        """
        设置银行卡号
        
        Args:
            bank_card_no: 银行卡号
            
        Returns:
            MerchRevOpenRequest实例
        """
        self.bank_card_no = bank_card_no
        return self
    
    def set_bank_card_name(self, bank_card_name):
        """
        设置银行卡姓名
        
        Args:
            bank_card_name: 银行卡姓名
            
        Returns:
            MerchRevOpenRequest实例
        """
        self.bank_card_name = bank_card_name
        return self
    
    def set_bank_code(self, bank_code):
        """
        设置银行代码
        
        Args:
            bank_code: 银行代码
            
        Returns:
            MerchRevOpenRequest实例
        """
        self.bank_code = bank_code
        return self
    
    def set_bank_name(self, bank_name):
        """
        设置银行名称
        
        Args:
            bank_name: 银行名称
            
        Returns:
            MerchRevOpenRequest实例
        """
        self.bank_name = bank_name
        return self
    
    def set_bank_branch_code(self, bank_branch_code):
        """
        设置银行支行代码
        
        Args:
            bank_branch_code: 银行支行代码
            
        Returns:
            MerchRevOpenRequest实例
        """
        self.bank_branch_code = bank_branch_code
        return self
    
    def set_bank_branch_name(self, bank_branch_name):
        """
        设置银行支行名称
        
        Args:
            bank_branch_name: 银行支行名称
            
        Returns:
            MerchRevOpenRequest实例
        """
        self.bank_branch_name = bank_branch_name
        return self
    
    def set_bank_front_source_id(self, bank_front_source_id):
        """
        设置银行卡正面照片来源ID
        
        Args:
            bank_front_source_id: 银行卡正面照片来源ID，开户类型为1、2时，必传
            
        Returns:
            MerchRevOpenRequest实例
        """
        self.bank_front_source_id = bank_front_source_id
        return self 


class MerchRevOpenResponse(BaseResponse):
    """商户分账开通响应"""
    
    def __init__(self, response_dict=None):
        """
        初始化商户分账开通响应
        
        Args:
            response_dict: 响应字典
        """
        super().__init__(response_dict)
        # 没有其他特定字段，只使用基础响应字段ret_code和ret_msg 